﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VGS
{
    /// <summary>
    /// This class contains a reference to a player and information
    /// about the number of points the player has made.
    /// </summary>
    public class PlayerStatistics
    {
        #region Properties
        /// <summary>
        /// Gets the number of serve points the player has made
        /// </summary>
        public int ServePoints
        {
            get; set;
        }

        /// <summary>
        /// Gets the number of attack points the player has made
        /// </summary>
        public int AttackPoints
        {
            get; set;
        }

        /// <summary>
        /// Gets the number of defense points the player has made
        /// </summary>
        public int DefensePoints
        {
            get; set;
        }
        #endregion

        #region Methods
        /// <summary>
        /// Increases serve points by one
        /// </summary>
        public void AddServePoint()
        {
            ServePoints++;
        }

        /// <summary>
        /// Decreases serve points by one if > 0
        /// </summary>
        public void RemoveServePoint()
        {
            if (ServePoints > 0)
                ServePoints--;
        }

        /// <summary>
        /// Increases attack points by one
        /// </summary>
        public void AddAttackPoint()
        {
            AttackPoints++;
        }

        /// <summary>
        /// Decreases attack points by one if > 0
        /// </summary>
        public void RemoveAttackPoint()
        {
            if (AttackPoints > 0)
                AttackPoints--;
        }

        /// <summary>
        /// Increases defense points by one
        /// </summary>
        public void AddDefensePoint()
        {
            DefensePoints++;
        }

        /// <summary>
        /// Decreases defense points by one if > 0
        /// </summary>
        public void RemoveDefensePoint()
        {
            if (DefensePoints > 0)
                DefensePoints--;
        }
        #endregion
    }
}
